<?php

declare(strict_types=1);

namespace App\Controller;


use App\Model\Article;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;
use Hyperf\HttpServer\Annotation\AutoController;

use Hyperf\Paginator\Paginator;
use Hyperf\Pool\SimplePool\PoolFactory;
use Hyperf\Server\ServerFactory;
use Swoole\Atomic;
use Swoole\WebSocket\Server;
use Swoole\Coroutine\Http\Client;

use App\Helps\TableStore;

/**
 * Class DemoController
 * @package App\Controller
 * @AutoController()
 */
class DemoController extends AbstractController
{


    public function __construct()
    {
        var_dump('__construct'.PHP_EOL);
    }

    public function index()
    {

        return 'index';
        Article::query()->create([
            'status' => 1,
            'title' => 'test',
            'content' => 'demo content',
            'preview' => 'demo preview',
            'read_count' => 0,
            'comment_count' => 0,
            'like_count' => 0
        ]);


        Article::query()->where(['title' => 'test'])->update(['content' => '测试content']);
        return 'demo';

    }

}
